/*
 * Juncao.java
 *
 * Created on 21 de Junho de 2007, 18:08
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package org.jerm.Interface.JGraph_Algebra;

import java.util.Vector;
import java.awt.geom.Rectangle2D;
import java.awt.Color;
import javax.swing.ImageIcon;

import org.jerm.Mapeamento.Atributos.*;
import org.jerm.Mapeamento.Tabelas.*;
import org.jgraph.graph.DefaultGraphCell;
import org.jgraph.graph.GraphConstants;


/**
 *
 * @author ra044637
 */
public class Juncao extends DefaultGraphCell {
    
    Consulta c1, c2;
    Consulta c_pai;
    
    /** Creates a new instance of Juncao */
    public Juncao(Consulta consulta1, Consulta consulta2, double x, double y, double w, double h, String condicoes) {
        super(condicoes);
        
        ImageIcon icon;
        icon = new ImageIcon(getClass().getClassLoader().getResource("org/jerm/Interface/Icones/juncao.png"));
        
        GraphConstants.setIcon(this.getAttributes(), icon);
        GraphConstants.setBounds(this.getAttributes(), new Rectangle2D.Double(x, y, w, h));
        this.addPort();
        
        this.c1 = consulta1;
        this.c2 = consulta2;
    }
       
    public Consulta getConsulta1()
    {
        return this.c1;
    }
    
    public Consulta getConsulta2()
    {
        return this.c2;
    }
    
    public void setConsultaP(Consulta consulta)
    {
        this.c_pai = consulta;
    }

    public Consulta getConsultaP()
    {
        return this.c_pai;
    }
    
}
